﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Camera_Ctl : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    //private void OnCollisionEnter(Collision collision)
    //{
    //    Debug.Log(collision.gameObject.name);
       
    //}
    private void OnTriggerEnter(Collider other)
    {
        //Debug.Log(other.name);
        if(other.gameObject.tag=="wall")
        {
            gameObject.GetComponent<Camera>().nearClipPlane = 1.5f;

        }
        
    }
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.tag == "wall")
            gameObject.GetComponent<Camera>().nearClipPlane = 0.03f;
    }
}
